package com.example.mongodb.demo.dao;

import com.example.mongodb.demo.model.entity.Shop;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ShopRepository extends MongoRepository<Shop, String> {

    @Query(fields = "{'isOpen': 0}")
    List<Shop> findByIsOpen(int isOpen);
}
